home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / PACKET / 7PLUSDLL / WIN7PLSR / COMMON.BAS < prev    next >
Encoding:
BASIC Source File  |  1997-01-24  |  2.3 KB  |  51 lines

  1. '
  2. ' Some commom stuff
  3. '
  4.  
  5. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  6. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, lpString As Any, ByVal lplFileName As String) As Integer
  7. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  8. Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, ByVal nCmdShow As Integer) As Integer
  9. Declare Function GetTickCount Lib "User" () As Long
  10. Declare Sub BringWindowToTop Lib "User" (ByVal hWnd As Integer)
  11. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  12.  
  13. Global Const WM_USER = &H400
  14. 'Used to set the tab stops in the list box
  15. Global Const LB_SETTABSTOPS = WM_USER + 19
  16. 'Used to add a horizontal scroll bar to the list boxes
  17. Global Const LB_SETHORIZONTALEXTENT = (WM_USER + 21)
  18. Global Const EM_SETREADONLY = (WM_USER + 31)
  19. Global Const WPF_RESTORETOMAXIMIZED = 2
  20. Global Const SWP_NOMOVE = 2
  21. Global Const SWP_NOSIZE = 1
  22. Global Const HWND_TOPMOST = -1
  23. Global Const HWND_NOTOPMOST = -2
  24.  
  25. Function File_Exist (Path)
  26. 'Returns a true if the file exists
  27.   If InStr(1, Path, Dir$(Path), 1) > 1 Then
  28.     File_Exist = True
  29.   Else
  30.     File_Exist = False
  31.   End If
  32. End Function
  33.  
  34. Function ini_get (filename As String, section As String, Variable As String)
  35. 'Returns an INI parameter from the specified INI file and specified section
  36.   Dim ret As String
  37.   ret = Space$(255)
  38.   r = GetPrivateProfileString(ByVal section, ByVal Variable, "", ret, Len(ret), filename)
  39.   ini_get = Left(ret, r)
  40. End Function
  41.  
  42. Function ini_get_int (filename As String, section As String, Variable As String) As Integer
  43. 'Returns an INI parameter from the specified INI file and specified section
  44.     ini_get_int = GetPrivateProfileInt(section, Variable, 0, filename)
  45. End Function
  46.  
  47. Sub INI_Set (filename As String, section As String, Variable As String, Value As String)
  48.     j = WritePrivateProfileString(section, ByVal Variable, ByVal Value, filename)
  49. End Sub
  50.  
  51.